<?php
namespace Opencart\Catalog\Controller\Extension\OpencartcityTranslate\Module;
class OpcTranslate extends \Opencart\System\Engine\Controller {
  public function index(&$route, &$data, &$code): void {
    if ($this->config->get('module_opc_translate_catalog_position') == 1) {
      $code = str_replace('<ul class="list-inline">', '<ul class="list-inline"><li class="list-inline-item">' . $this->config->get("module_opc_translate_default_code") . '</li>', $code);
    } elseif ($this->config->get('module_opc_translate_catalog_position') == 2) {
      $code = str_replace('<ul class="list-inline">', '<ul class="list-inline"><li class="list-inline-item" style="position: absolute; left: 35%;">' . $this->config->get("module_opc_translate_default_code") . '</li>', $code);
    } else {
      $code = str_replace('<div class="nav float-end">', '<div class="nav float-end">' . $this->config->get("module_opc_translate_default_code") . '</div><div class="nav float-end">', $code);
    }
  }
}
